package com.saunter.utils.encrypt;

import sun.misc.BASE64Encoder;
import java.security.MessageDigest;

public class Md5Encrypt {
    public static String encrypt(String str) {
        try {
            MessageDigest md5=MessageDigest.getInstance("MD5");
            BASE64Encoder base64en = new BASE64Encoder();
            return base64en.encode(md5.digest(str.getBytes("utf-8")));
        }catch (Exception e){
            e.printStackTrace();
        }
        return str;
    }
}
